<?
/************************************************************************/
/* FrameWork  test preview                                              */
/* ==================================================================== */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/


/* Home Page */


/* solo gli amministratori registrati possono cambiare il testo dell'home page */
if ((defined('LIBGROUP') && group_getusergroup("webmaster",user_getuser())) || admin_verifyIP()){
    $save=$_POST['save'];
    $datas=$_POST['ta'];
    $datas=str_replace("\'","'",$datas);
    $datas=str_replace("\\\"","\"",$datas);
    $code=$_POST['codice'];
    $code=str_replace("\'","'",$code);
    $code=str_replace("\\\"","\"",$code);

    if($save!=""){
	$fp=fopen($save,"w");
	fwrite($fp,$datas);
	fclose($fp);

	$fp=fopen("$save.codice","w");
	fwrite($fp,$code);
	fclose($fp);
    }
}
/*******************************************************************************/



?>
<?php structure_openBlock("table appl",apptitle($appname),""); ?>

<div class='table'>
 <h3 class='bartitle'><?=$apptitle?></h3>
<p>
<style>
h3
{
	margin: 0;
	font-size: 14px;
}

</style>
<?php
      echo "<script>";
      include "$path/$apptitle/pagina.codice";
      echo "</script>";
    echo join(file("$path/$apptitle/pagina"));
?>
</p>
<?php if ((defined('LIBGROUP') && group_getusergroup("vbtool",user_getuser())) || admin_verifyIP()){ ?>
<h3><a href='index.php?appname=vbtool&op=edit&appdest=<?=$_GET['appname'];?>&file=<?="$path/$apptitle"?>/pagina'>edit</a></h3>
<?php } ?>
</div>
<?php structure_closeBlock(); ?>

